﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using TrinityAPI.Base.Tools;

namespace TrinityAPI.Base.Models
{
    public class Parameter
    {
        private string _path;
        private JToken _value;
        private List<Function> _functions;

        public string Path
        {
            get { return _path; }
        }

        public JToken Value
        {
            get { return _value; }
        }

        public List<Function> Functions
        {
            get { return _functions; }
        }

        public Parameter(string path, JToken value)
        {
            this._path = path;
            this._value = value;
        }

        public Parameter(string path, JToken value, List<Function> functions)
        {
            this._path = path;
            this._value = value;
            this._functions = functions;
        }

        public Parameter(string path, JObject dataset, List<Function> functions)
        {
            this._path = path;
            this._value = Utils.GetValueByPath(path, dataset);
            this._functions = functions;
        }
    }
}
